When slavery was in existence there wasn't enough atheists in any slave holding country for the atheists by themselves to bring about an end to slavery. However in the USA there were freethinkers (including atheists) who were very outspoken against slavery. Virtually all of the slaveholders in the southern USA were Christians. The Baptist church (and others, such the Presbyterians) split over the issue of slavery of blacks. The southern congregations (at least a high percentage of them) of the Baptist church sided for the right to own black slaves and such is part of the history of the Southern Baptist Convention (see https://en.wikipedia.org/wiki/Southern_Baptist_Convention ) - the largest Protestant denomination in the USA (see https://www.vox.com/policy-and-politics/22538281/southern-baptist-convention-ed-litton-sex-abuse-critical-race-theory ).
In one of the Apostle Paul's letters (or at least one written in his name) which is in the Bible, Paul wrote that he sent an escaped slave (who converted to Christianity after his escape) back to his Christian master (see Philemon 1:10-20). In another letter Paul wrote that slaves must be obedient to their masters.
Those Christians who ended slavery in the USA were mostly the ones who were more theologically liberal and progressive (such as the Quakers and Abraham Lincoln, except I'm not sure if Lincoln was really a Christian) than the pro-slavery Christians.
Frederick Douglass (an escaped slave who obtained his freedom and was later appointed to federal government office) in his autobiography said the church going Christian slaveholders were more brutal towards their slaves than the ones not claiming to be Christians (or maybe than the ones who were less devout as Christians). Along these lines, see https://www.pbs.org/thisfarbyfaith/people/frederick_douglass.html which says the following. 'In an appendix to his autobiography, Narrative of the Life of an American Slave, published in 1845, Douglass clarified that he was not opposed to all religion, but only the Christianity of a slaveholding America: "I love the pure, peaceable, and impartial Christianity of Christ: I therefore hate the corrupt, slaveholding, women-whipping, cradle-plundering, partial and hypocritical Christianity of this land. Indeed, I can see no reason, but the most deceitful one, for calling the religion of this land Christianity. I look upon it as the climax of all misnomers, the boldest of all frauds, and the grossest of all libels…" '
For more information about Douglass see https://www.nps.gov/museum/exhibits/douglass/visionary.html and https://en.wikipedia.org/wiki/Frederick_Douglass . The latter source says: "Without his permission, Douglass became the first African-American nominated for Vice President of the United States as the running mate and Vice Presidential nominee of Victoria Woodhull, on the Equal Rights Party ticket."